/*
 * ADS.h -> Auxiliary Data Structures
 */

#ifndef ADS_H_
#define ADS_H_

class ADS
{
private:
	double delta;
	double delta_inf;
	double currentPeriod;

	//  variavel que guarda em quais períodos um cliente se encontra
	vector<vector<int> > local_cli;
	// variavel que guarda quais períodos foram modificados
	vector<bool> status;
	// varialvel que guarda o load de cada rota
	vector<vector<double> > load;
public:
	ADS(int size, int nPeriod)
	{
		vector < vector<int> > local_cli_temp(size);
		local_cli = local_cli_temp;

		vector<bool> status_temp(nPeriod, false);
		status = status_temp;

		vector < vector<double> > load_temp(nPeriod);
		load = load_temp;

		delta = 0;
		delta_inf = 0;
		currentPeriod = 0;
	}

	ADS(const ADS& ads)
	{
		this->currentPeriod = ads.currentPeriod;
		this->delta = ads.delta;
		this->delta_inf = ads.delta_inf;
		this->load = ads.load;
		this->local_cli = ads.local_cli;
		this->status = ads.status;
	}

	virtual ~ADS()
	{
	}

	virtual ADS& operator=(const ADS& ads)
	{
		if (&ads == this) // auto ref check
			return *this;

		this->currentPeriod = ads.currentPeriod;
		this->delta = ads.delta;
		this->delta_inf = ads.delta_inf;
		this->load = ads.load;
		this->local_cli = ads.local_cli;
		this->status = ads.status;

		return *this;
	}

	vector<vector<int> >& getLocal_cli()
	{
		return local_cli;
	}

	const vector<vector<int> >& getLocal_cli() const
	{
		return local_cli;
	}

	vector<bool>& getStatus()
	{
		return status;

	}

	const vector<bool>& getStatus() const
	{
		return status;

	}

	double getDelta()
	{
		return delta;
	}

	double getDelta_inf()
	{
		return delta_inf;
	}

	double getCurrentPeriod()
	{
		return currentPeriod;
	}

	vector<vector<double> >& getLoad()
	{
		return load;
	}

	vector<double>& getRouteLoad()
	{
		return load.at(currentPeriod);
	}

	void setDelta(double _d)
	{
		delta = _d;
	}

	void setDelta_inf(double _d_inf)
	{
		delta_inf = _d_inf;
	}

	void setCurrentPeriod(int p)
	{
		currentPeriod = p;
	}
};

#endif /* ADS_H_ */
